#include "addrelation_menu.h"
#include "ui_addrelation_menu.h"

AddRelation_menu::AddRelation_menu(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::AddRelation_menu)
{
    ui->setupUi(this);

    connect(ui->addRelation_BT,&QPushButton::clicked,[this](){
        this->hide();
        emit onHide();
        emit showSearchFriend();
    });
    connect(ui->createGroup_BT,&QPushButton::clicked,[this](){
        this->hide();
        emit onHide();
    });

    //设置主窗口的阴影
    QGraphicsDropShadowEffect *mainShadow = new QGraphicsDropShadowEffect(this);
    mainShadow->setOffset(0,1); // 设置阴影偏移量
    mainShadow->setBlurRadius(25); // 设置阴影模糊半径
    mainShadow->setColor(QColor(150, 150, 150)); // 设置阴影颜色（RGBA）
    this->setGraphicsEffect(mainShadow);
}

AddRelation_menu::~AddRelation_menu()
{
    delete ui;
}

void AddRelation_menu::mousePressEvent(QMouseEvent *event){

}
void AddRelation_menu::focusInEvent(QFocusEvent *event){

}
void AddRelation_menu::focusOutEvent(QFocusEvent *event){
    this->hide();
    emit onHide();
}
